import request from '@/utils/request'

/**
 * 获取权限列表(接口无法使用)
 * @returns
 */
export const getPermissionListApi = () => {
  return request({
    url: '/sys/permission'
  })
}

/**
 * 添加权限
 * @param {*} data 权限信息
 * @returns
 */
export const addPermissionApi = (data) => {
  return request({
    url: '/sys/permission',
    method: 'post',
    data
  })
}

/**
 * 删除权限角色
 * @param {*} id 角色id
 * @returns
 */
export const delPermissionApi = id => {
  return request({
    url: `/sys/permission/${id}`,
    method: 'delete'
  })
}

/**
 * 获取权限详情
 * @param {*} id 角色id
 * @returns
 */
export const getPermissionDetailApi = id => {
  return request({
    url: `/sys/permission/${id}`
  })
}

/**
 *编辑权限
 */
export const editPermissionApi = data => {
  return request({
    url: `/sys/permisssion/${data.id}`,
    method: 'put',
    data
  })
}
